package com.feinno.urcs.group.api;

import com.feinno.urcs.group.GroupException;
import com.feinno.urcs.group.entity.GroupFileInfo;
import com.feinno.urcs.group.siptask.task.GroupSmsArgs;
import com.feinno.urcs.profile.entity.ClientType;
import com.feinno.urcs.sipservlet.SipServletRequest;
import com.feinno.urcs.types.MobileNo;
import org.helium.framework.annotations.ServiceInterface;

import java.io.IOException;
import java.util.Date;
import java.util.List;

/**
 * 群会话服务, 提供群组会话服务
 * Created by Lei Gao on 5/12/15.
 */
@ServiceInterface(id = "group:GroupChatService")
public interface GroupChatService {
	/**
	 * 加入群会话
	 * @param groupId
	 * @param memberMobile 用户手机号
	 * @param receiver 用于接收群消息的代理
	 */
	//void join(int groupId, String memberMobile, GroupChatReceiver receiver) throws Exception;

	/**
	 * 退出群会话，客户端断开连接或bye
	 * @param groupId
	 * @param memberMobile 用户手机号
	 */
	//void leave(int groupId, String memberMobile) throws Exception;

	/**
	 * 群内发送文本消息
	 * @param groupId
	 * @param memberMobile 发送方
	 * @param contentType
	 * @param content
	 * @param groupAtMembers
	 * @param sendTime
	 */
	void sendText(int groupId, MobileNo memberMobile, String contentType, byte[] content, ClientType clientType, List<MobileNo> groupAtMembers, Date sendTime) throws Exception;

	void sendFile(int groupId, MobileNo memberMobile, GroupFileInfo fileInfo, Date sendTime) throws Exception;

	void sendSms(MobileNo sender, int groupId, String content) throws GroupException;

	void sendSms(MobileNo sender, int groupId, SipServletRequest request) throws GroupException, IOException;
}
